//package com.plian.system.controller.dg;
//
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.annotation.Behavioral;
//import com.plian.system.config.Resubmit;
//import com.plian.system.entity.dg.PolicyLegalLibrary;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.model.token.PassToken;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.dg.IPolicyLegalLibraryService;
//import com.plian.system.vo.dg.PolicyLegalLibraryVO;
//import com.plian.system.wrapper.dg.PolicyLegalLibraryWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiResponse;
//import io.swagger.annotations.ApiResponses;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.servlet.http.HttpServletResponse;
//import javax.validation.Valid;
//import java.util.List;
//
///**
// * 制度政策法规库管理
// */
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/policylegallibrary")
//@Api(value = "PolicyLegalLibraryController", tags = "制度政策法规库管理")
//public class PolicyLegalLibraryController extends BaseController {
//
//
//    private final IPolicyLegalLibraryService policyLegalLibraryService;
//
//    private final PolicyLegalLibraryWrapper policyLegalLibraryWrapper;
//
//
//    /**
//     * 新增或修改
//     *
//     * @param policyLegalLibraryVO
//     * @return
//     */
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "新增或修改", notes = "传入 policyLegalLibrary")
//    public R submitChange(@Valid @RequestBody PolicyLegalLibraryVO policyLegalLibraryVO) {
//        return policyLegalLibraryService.submit(policyLegalLibraryVO)
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//
//    /**
//     * 详情
//     */
//    @ApiOperation(value = "详情", notes = "详情")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 1999, message = "操作失败"),
//    })
//    @PostMapping("/detail")
//    @Behavioral()
//    public R detail(@RequestBody PolicyLegalLibrary policyLegalLibrary) {
//        return R.data(policyLegalLibraryService.detail(policyLegalLibrary));
//    }
//
//    /**
//     * 分页
//     *
//     * @param query
//     * @return
//     */
//    @ApiOperation(value = "分页", notes = "传入query")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 1999, message = "操作失败"),
//    })
//    @PostMapping("/list")
//    public ListResult<PolicyLegalLibraryVO> list(@RequestBody Query query) {
//        return policyLegalLibraryService.list(query);
//    }
//
//    /**
//     * 删除
//     */
//    @ApiOperation(value = "删除", notes = "删除")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 1999, message = "操作失败"),
//    })
//    @PostMapping("/submit")
//    public R remove(@RequestBody PolicyLegalLibraryVO vo) {
//        List<String> ids = vo.getIds();
//        return policyLegalLibraryService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//    /**
//     * 修改时效状态
//     *
//     * @return
//     * @param:
//     * @date: 2023/4/10 11:21 AM
//     * @author: jatpeo
//     */
//    @PostMapping("/change")
//    @ApiOperation(value = "修改时效状态", notes = "修改时效状态")
//    public R changeAgingStatus(@RequestBody PolicyLegalLibraryVO vo) {
//        return policyLegalLibraryService.changeAgingStatus(vo)
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//    /**
//     * 增加预览文件次数
//     *
//     * @return
//     * @param:
//     * @date: 2023/4/10 11:21 AM
//     * @author: jatpeo
//     */
//    @PostMapping("/preview")
//    @PassToken
//    @ApiOperation(value = "预览文件", notes = "预览文件")
//    public R preview(@RequestBody PageData pageData) {
//        return policyLegalLibraryService.preview(pageData.getString("id"))
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//    /**
//     * 增加下载文件次数
//     *
//     * @return
//     * @param:
//     * @date: 2023/4/10 11:21 AM
//     * @author: jatpeo
//     */
//    @PostMapping("/download")
//    @PassToken
//    @ApiOperation(value = "下载文件", notes = "下载文件")
//    public void download(@RequestBody PageData pageData, HttpServletResponse response) {
//        policyLegalLibraryService.download(pageData.getString("id"), response);
//    }
//
//
//}
